require "Common/class"
require "Common/util"
require "Common/eventsystem"
require "Common/event_dispatcher"
require "Common/stack"
require "Common/queue"
require "Common/array"
require "UI/Common/require_common"

local _BagController = require "UI/Bag/bag_controller"
local _MainController = require "UI/Main/main_controller"

--主入口函数。从这里开始lua逻辑
function Main()					
	print("logic start")
	print(_G._VERSION)

	-- _MainController.New()
	-- _BagController.New()
	_MainController:GetInstance()
	_BagController:GetInstance()
	-- print(UpdateBeat)
	-- PrintTable(UpdateBeat)
	-- for k, v in pairs(UpdateBeat) do
	-- 	print(k, v)
	-- 	if type(v) == "table" then
	-- 		for k1, v1 in pairs(v) do
	-- 			print(k1, v1)
	-- 		end
	-- 	end
	-- end
	-- UpdateBeat.Update(self, Update)
end

--场景切换通知
function OnLevelWasLoaded(level)
	collectgarbage("collect")
	Time.timeSinceLevelLoad = 0
end

function OnApplicationQuit()
end

function Update()
	-- body
end